import React from 'react'
import { useParams } from "react-router-dom";
import jsonH5XZHtmlPage from '../../axios/H5XZHtmlPageIndex.json'

export default function HtmlPage() {
    const params = useParams()
    //过滤出符合titleID的页面内容
    let contentPage = jsonH5XZHtmlPage.data.filter(person => person.titleID === `${params.titleID}`)

    return (
        <div className='HtmlPage shadow bg-body-tertiary rounded border'>
            {console.log(contentPage[0].src)}
            {/* 注意：当文件地址在public里面时，src的地址必须以/开头，不可省略 */}
            <iframe
                width="1520"
                height={contentPage[0].height}
                src={`${contentPage[0].src}`}>
            </iframe>
        </div >

    )
}
